const ctx = new AudioContext();
const osc = ctx.createOscillator();
osc.connect(ctx.destination);
osc.frequency.value = 50;
osc.start(0);

const input = document.createElement("input");
input.type = "range";
input.min = 0;
input.max = 2500;
input.value = 50;
input.step = 0.01;
input.setAttribute("style", "display:block;width: 80%;margin: 100px auto;");
input.addEventListener("input", (e) => {
  osc.frequency.value = +e.target.value;
});
document.body.appendChild(input);
